<!DOCTYPE html>
<title>Geolocation On A Secure Origin</title>
<script type="module">
import {GeolocationMock} from '/wpt_internal/geolocation-api/resources/geolocation-mock.js';

const mockLatitude = 51.478;
const mockLongitude = -0.166;
const mockAccuracy = 100.0;

const mock = new GeolocationMock();
mock.setGeolocationPermission(true);
mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy);

navigator.geolocation.getCurrentPosition(
    function () {
        window.parent.postMessage({ success: true }, "*");
    },
    function (error) {
        window.parent.postMessage({ message: error.message }, "*");
    }, { maximumAge: 10000 });
</script>
